package com.shop2cn.app.liveseller.service;

import com.google.gson.JsonArray;
import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*直播商品列表Call
*FreeMaker Template自动生成代码
*/
public class LiveProductListCall extends YmatouBaseCall{
	private static String opurl ="api/live/LiveProductList";
	
	public LiveProductListCall() {
		super(EnvSetup.getSystemUrl("liveseller_app"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public int getOnsaleCount(){
		return getJsonObject().get("liveProdcutTab").getAsJsonObject().get("onsaleCount").getAsInt();
	}
	public int getSoldOutCount(){
		return getJsonObject().get("liveProdcutTab").getAsJsonObject().get("soldOutCount").getAsInt();
	}
	public int getSuspendCount(){
		return getJsonObject().get("liveProdcutTab").getAsJsonObject().get("suspendCount").getAsInt();
	}
	public JsonArray getProductList(){
		return getJsonObject().get("productList").getAsJsonArray();
	}
}